#include "TNode.h"

TNode::TNode(NODETYPE ntype, int stmt_num) 
{
	this->node_type = ntype;
	this->statement_number = stmt_num;
	this->value = "";
	this->parent_node = NULL;
	this->right_sibling = NULL;
}

TNode::~TNode() 
{
	/*delete this->parent_node;
	delete this->right_sibling;
	*/
	std::map<int, TNode*>::const_iterator it;
	for (it = child_nodes.begin(); it != child_nodes.end(); ++it)
	{
		delete it->second;
	}
}

void TNode::add_child(TNode* node,INTEGER position)
{
	this->child_nodes.insert(pair<int,TNode*>(position,node));
}